﻿Public Class LIQUIDEZ

    Private Sub LIQUIDEZ_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.LIQUIDEZTableAdapter.Fill(Me.LIQUIDEZDataSet.LIQUIDEZ)
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.LIQUIDEZTableAdapter.Fill(Me.LIQUIDEZDATASET.LIQUIDEZ)
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If CEDENTETextBox.Text = "" Then
            MsgBox("FAVOR INFORMAR O CEDENTE", MsgBoxStyle.Information, "ATENÇÃO")
        Else
            LIQUIDEZTableAdapter.FillByCEDENTE(LIQUIDEZDataSet.LIQUIDEZ, CEDENTETextBox.Text)
        End If
    End Sub

    Private Sub DELETAR_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DELETAR.Click
        Try
            Me.Validate()
            LIQUIDEZBindingSource.RemoveCurrent()
            LIQUIDEZTableAdapter.Update(Me.LIQUIDEZDataSet.LIQUIDEZ)
        Catch EX As Exception
            MsgBox("ERRO AO DELETAR O REGISTRO " & EX.ToString)
        End Try
    End Sub

    Private Sub PRIMEIRO_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PRIMEIRO.Click
        LIQUIDEZBindingSource.MoveFirst()
    End Sub

    Private Sub VOLTAR_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VOLTAR.Click
        LIQUIDEZBindingSource.MovePrevious()
    End Sub

    Private Sub NOVO_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NOVO.Click
        LIQUIDEZBindingSource.AddNew()
        CEDENTETextBox.Focus()
    End Sub

    Private Sub SALVAR_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SALVAR.Click
        Try
            Me.Validate()
            LIQUIDEZBindingSource.EndEdit()
            TableAdapterManager.UpdateAll(Me.LIQUIDEZDataSet)
        Catch EX As Exception
            MsgBox("ERRO NA ATUALIZAÇÃO DOS DADOS " & EX.ToString)
        End Try
    End Sub

    Private Sub FRENTE_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FRENTE.Click
        LIQUIDEZBindingSource.MoveNext()
    End Sub

    Private Sub ULTIMO_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ULTIMO.Click
        LIQUIDEZBindingSource.MoveLast()
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        IMPRIMIR.MdiParent = PRINCIPAL
        IMPRIMIR.Show()
    End Sub
End Class